<%@ page language="java" contentType="image" import="java.io.*"%><jsp:useBean id="utilities" class="masterpiece.util.Utilities" scope="page" /><%

try {
	// This file uses an ad-hoc connection so that multple images may be read
	// at once.
	utilities.openDB();
	
	int     id    = Integer.parseInt(request.getParameter("id"));
	boolean large = Boolean.parseBoolean(request.getParameter("large"));
	
	InputStream stream = utilities.getPictureData(id, large);
	
	int b = stream.read();
	while (b != -1) {
		out.write(b);
		b = stream.read();
	}
	
} catch (Exception e) {
	e.printStackTrace();
}

%>